import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';

class TransactionEntity with JsonConvert<TransactionEntity> {
  @JSONField(name: "data_type")
  String dataType;
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "transaction_type")
  String transactionType;
  @JSONField(name: "transactionable_type")
  String transactionableType;
  @JSONField(name: "transactionable_id")
  int transactionableId;
  @JSONField(name: "contact_id")
  int contactId;
  String name;
  dynamic number;
  @JSONField(name: "is_overdue")
  int isOverdue;

  @JSONField(name: "currency_code")
  String currencyCode;
  @JSONField(name: "tax_amount")
  num taxAmount;
  num total;
  num unpaid;
  @JSONField(name: "issued_at")
  String issuedAt;
  @JSONField(name: "due_at")
  dynamic dueAt;
  String status;
  @JSONField(name: "created_by")
  dynamic createdBy;
  @JSONField(name: "created_at")
  String createdAt;
  @JSONField(name: "updated_at")
  String updatedAt;
  @JSONField(name: "employee_id")
  String employeeId;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is TransactionEntity &&
          runtimeType == other.runtimeType &&
          dataType == other.dataType &&
          id == other.id &&
          companyId == other.companyId &&
          transactionType == other.transactionType &&
          transactionableType == other.transactionableType &&
          transactionableId == other.transactionableId &&
          contactId == other.contactId &&
          name == other.name &&
          number == other.number &&
          isOverdue == other.isOverdue &&
          currencyCode == other.currencyCode &&
          taxAmount == other.taxAmount &&
          total == other.total &&
          unpaid == other.unpaid &&
          issuedAt == other.issuedAt &&
          dueAt == other.dueAt &&
          status == other.status &&
          createdBy == other.createdBy &&
          createdAt == other.createdAt &&
          updatedAt == other.updatedAt &&
          employeeId == other.employeeId;

  @override
  int get hashCode =>
      dataType.hashCode ^
      id.hashCode ^
      companyId.hashCode ^
      transactionType.hashCode ^
      transactionableType.hashCode ^
      transactionableId.hashCode ^
      contactId.hashCode ^
      name.hashCode ^
      number.hashCode ^
      isOverdue.hashCode ^
      currencyCode.hashCode ^
      taxAmount.hashCode ^
      total.hashCode ^
      unpaid.hashCode ^
      issuedAt.hashCode ^
      dueAt.hashCode ^
      status.hashCode ^
      createdBy.hashCode ^
      createdAt.hashCode ^
      updatedAt.hashCode ^
      employeeId.hashCode;
}
